<!-- 个人中心 -->
<template>
	<view style="height: 100vh;margin-left: 15px;margin-right: 15px;margin-top: 15px;">
		<view class="shop-list" v-if="shopList.length>0">
			<view v-for="(item, i) in shopList" :key="item.id">
				<view style="display: flex;margin-top: 30rpx;">
				<view><image style="width: 196rpx;height: 206rpx;" :src="item.image"></image></view>
				<view style="display: flex;flex-direction: column;margin-left: 27rpx;">
					<view class="shop-name">{{item.title}}</view>
					<view style="display: flex;flex: 1;">
						<view class="moneyold">￥{{item.marketprice}}</view>
						<view class="moneynew">￥{{item.price}}</view>
					</view>
					<view style="display: flex;">
						<view class="yongjin">预计佣金：</view>
						<view class="yongjinnum">￥{{item.xtension_money}}</view>
						<view class="fenxiang" @click="fxz(item)">分享赚</view>
					</view>
				</view>
				
				</view>
				<view class="shop-br" ></view>
		</view>
		<view class="wu" v-if="shopList.length>0">
			<view class="hengxian"></view>
			<view class="gengduo">没有更多了</view>
			<view class="hengxian"></view>
		</view>
		</view>
		<view class="zanwubox" v-if="shopList.length<=0">
			<view>
				<image style="width: 261rpx;height: 175rpx;" src="../../static/image/fenxiao21.png"></image>
			</view>
			<view class="zhanwu">暂无数据</view>
		</view>
       <view class="" >
        	<fa-share :goods-id="info.id" :title="info.name" :summary="info.intro" :imageUrl="info.image_text" v-model="showShare"
        	 @shares="showPoster = true"></fa-share>
        	<fa-poster v-model="showPoster" :goods="info"></fa-poster>
        </view>
	</view>
</template>

<script>
 // #ifdef H5
 import {
 	weixinShare
 } from '@/common/fa.weixin.mixin.js';
 // #endif
	export default {
    
		data() {
			return {
				shopList: [
				],
                info:{},
                showShare:false,
                showPoster:false
			};
		},
        mixins: [
        	// #ifdef H5
        	weixinShare
        	// #endif
        ],
        mounted() {
            this.getData()
        },
		methods: {
	getData() {
				let that = this
				that.$api.goodsList({
				}).then(res => {
					console.log('res', res)
					if (res.code == 1) {
						that.shopList = res.data
					}
				});
			},
            fxz(item){
                
                this.info=item
                this.showShare=true
            }
		}
	};
</script>

<style lang="scss" scoped>
	* {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
	}


	.zhanwu {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
	}

	.zanwubox {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 200rpx;
	}

	.shop-list {
		
		    background: #FFFFFF;
		    border-radius: 5px;
	}

	.fenxiang{
		background-size: 100% 100%;
		width: 172rpx;
		height: 74rpx;
		background-image: url('/static/image/fenxiao24.png');
		text-align: center;
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
		// margin-left: 20rpx;
		line-height: 54rpx;
        position: absolute;
            right: 20rpx;
	}
	.shop-name{
		font-size: 32rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #333333;
		flex: 1;
	}
	.moneyold{
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #333333;
	}
	.moneynew{
		font-size: 26rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		text-decoration: line-through;
		color: #999999;
		margin-left: 19rpx;
	}
	.yongjin{
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #F16009;
	}
	.yongjinnum{
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #F16009;
	}
	.shop-br{
		    border-bottom: 1px solid rgb(238, 238, 238);
		      margin-top: 30rpx;
	}
	.hengxian{
		background-size: 100% 100%;
		width: 97rpx;
		height: 1rpx;
		background-image: url('/static/image/fenxiao25.png');
	}
	.wu{
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 36rpx;
	}
	.gengduo{
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
		margin-left: 37rpx;
		margin-right: 37rpx;
	}
</style>
